`timescale 1ns/1ns

module tb_mux2_1();


//声明变量
reg in_1;
reg in_2;
reg out;

wire out;

//初始化
initial begin
    in_1 <= 1'b0;
    in_2 <= 1'b0;
    sel <= 1'b0;
end

//赋值，这里采用随机数的方式
always #10 in_1 <= {$random} % 2;
always #10 in_2 <= {$random} % 2;
always #10 sel <= {$random} % 2;

//调用一些系统函数，进行观察
initial
    begin
        $timeformat(-9,0,"ns",6);
        $monitor("@time %t:in_1=%b in_2=%b sel=%b out=%b", $time,in_1,in_2,sel,out);
    end


//实例化，类似于调用mux2_1.v中的函数
mux2_1 mux2_1_inst
(
    .in_1(in_1),
    .in_2(in_2),
    .sel(sel),

    .out(out)
);
endmodule